<template>
  <div>
    <button @click="getHeadCom">获取MyHeader组件上的ref</button>
    <MyHeader ref="headCom"/>
    <Count/>
  </div>
</template>

<script>
import MyHeader from './components/MyHeader'
import Count from './components/Count'
export default {
  name:'App',
  components:{
    MyHeader,
    Count
  },
  methods:{
    getHeadCom(){
      console.log(this.$refs);
      console.log(this.$refs.headCom);
    }
  }
}
</script>

<style scoped>

</style>